
/*
 * Copyright 2002-2021 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2021原作者。
 *
 *根据Apache许可证2.0版（“许可证”）获得许可；
 *除非符合许可证，否则不得使用此文件。
 *您可以在以下地址获取许可证副本：
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，软件
 *根据许可证分发的内容是按“原样”分发的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限和
 *许可证下的限制。
 */

package org.springframework.beans.factory;

import org.springframework.beans.BeansException;
import org.springframework.core.ResolvableType;
import org.springframework.lang.Nullable;

/**
 * The root interface for accessing a Spring bean container.
 *
 * <p>This is the basic client view of a bean container;
 * further interfaces such as {@link ListableBeanFactory} and
 * {@link org.springframework.beans.factory.config.ConfigurableBeanFactory}
 * are available for specific purposes.
 *
 * <p>This interface is implemented by objects that hold a number of bean definitions,
 * each uniquely identified by a String name. Depending on the bean definition,
 * the factory will return either an independent instance of a contained object
 * (the Prototype design pattern), or a single shared instance (a superior
 * alternative to the Singleton design pattern, in which the instance is a
 * singleton in the scope of the factory). Which type of instance will be returned
 * depends on the bean factory configuration: the API is the same. Since Spring
 * 2.0, further scopes are available depending on the concrete application
 * context (e.g. "request" and "session" scopes in a web environment).
 *
 * <p>The point of this approach is that the BeanFactory is a central registry
 * of application components, and centralizes configuration of application
 * components (no more do individual objects need to read properties files,
 * for example). See chapters 4 and 11 of "Expert One-on-One J2EE Design and
 * Development" for a discussion of the benefits of this approach.
 *
 * <p>Note that it is generally better to rely on Dependency Injection
 * ("push" configuration) to configure application objects through setters
 * or constructors, rather than use any form of "pull" configuration like a
 * BeanFactory lookup. Spring's Dependency Injection functionality is
 * implemented using this BeanFactory interface and its subinterfaces.
 *
 * <p>Normally a BeanFactory will load bean definitions stored in a configuration
 * source (such as an XML document), and use the {@code org.springframework.beans}
 * package to configure the beans. However, an implementation could simply return
 * Java objects it creates as necessary directly in Java code. There are no
 * constraints on how the definitions could be stored: LDAP, RDBMS, XML,
 * properties file, etc. Implementations are encouraged to support references
 * amongst beans (Dependency Injection).
 *
 * <p>In contrast to the methods in {@link ListableBeanFactory}, all of the
 * operations in this interface will also check parent factories if this is a
 * {@link HierarchicalBeanFactory}. If a bean is not found in this factory instance,
 * the immediate parent factory will be asked. Beans in this factory instance
 * are supposed to override beans of the same name in any parent factory.
 *
 * <p>Bean factory implementations should support the standard bean lifecycle interfaces
 * as far as possible. The full set of initialization methods and their standard order is:
 * <ol>
 * <li>BeanNameAware's {@code setBeanName}
 * <li>BeanClassLoaderAware's {@code setBeanClassLoader}
 * <li>BeanFactoryAware's {@code setBeanFactory}
 * <li>EnvironmentAware's {@code setEnvironment}
 * <li>EmbeddedValueResolverAware's {@code setEmbeddedValueResolver}
 * <li>ResourceLoaderAware's {@code setResourceLoader}
 * (only applicable when running in an application context)
 * <li>ApplicationEventPublisherAware's {@code setApplicationEventPublisher}
 * (only applicable when running in an application context)
 * <li>MessageSourceAware's {@code setMessageSource}
 * (only applicable when running in an application context)
 * <li>ApplicationContextAware's {@code setApplicationContext}
 * (only applicable when running in an application context)
 * <li>ServletContextAware's {@code setServletContext}
 * (only applicable when running in a web application context)
 * <li>{@code postProcessBeforeInitialization} methods of BeanPostProcessors
 * <li>InitializingBean's {@code afterPropertiesSet}
 * <li>a custom {@code init-method} definition
 * <li>{@code postProcessAfterInitialization} methods of BeanPostProcessors
 * </ol>
 *
 * <p>On shutdown of a bean factory, the following lifecycle methods apply:
 * <ol>
 * <li>{@code postProcessBeforeDestruction} methods of DestructionAwareBeanPostProcessors
 * <li>DisposableBean's {@code destroy}
 * <li>a custom {@code destroy-method} definition
 * </ol>
 *
 * @author Rod Johnson
 * @author Juergen Hoeller
 * @author Chris Beams
 * @since 13 April 2001
 * @see BeanNameAware#setBeanName
 * @see BeanClassLoaderAware#setBeanClassLoader
 * @see BeanFactoryAware#setBeanFactory
 * @see org.springframework.context.EnvironmentAware#setEnvironment
 * @see org.springframework.context.EmbeddedValueResolverAware#setEmbeddedValueResolver
 * @see org.springframework.context.ResourceLoaderAware#setResourceLoader
 * @see org.springframework.context.ApplicationEventPublisherAware#setApplicationEventPublisher
 * @see org.springframework.context.MessageSourceAware#setMessageSource
 * @see org.springframework.context.ApplicationContextAware#setApplicationContext
 * @see org.springframework.web.context.ServletContextAware#setServletContext
 * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization
 * @see InitializingBean#afterPropertiesSet
 * @see org.springframework.beans.factory.support.RootBeanDefinition#getInitMethodName
 * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization
 * @see org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor#postProcessBeforeDestruction
 * @see DisposableBean#destroy
 * @see org.springframework.beans.factory.support.RootBeanDefinition#getDestroyMethodName
 */
/**
 *用于访问Springbean容器的根接口。
 *
 *＜p＞这是bean容器的基本客户端视图；
 *其他接口，如｛@link ListableBeanFactory｝和
 *｛@link org.springframework.beans.factory.config.ConfigableBeanFactory｝
 *可用于特定目的。
 *
 *＜p＞这个接口由持有许多bean定义的对象实现，
 *每个都由字符串名称唯一标识。根据bean定义，
 *工厂将返回包含对象的独立实例
 *（原型设计模式），或单个共享实例（上级
 *替代Singleton设计模式，其中实例是
 *工厂范围内的单例）。将返回哪种类型的实例
 *取决于bean工厂配置：API是相同的。自春季以来
 *2.0，根据具体应用，可提供更多范围
 *上下文（例如，web环境中的“请求”和“会话”范围）。
 *
 *＜p＞这种方法的要点是BeanFactory是一个中央注册中心
 *应用程序组件，并集中配置应用程序
 *组件（单个对象不再需要读取财产文件，
 *例如）。请参阅“Expert One on One J2EE Design and
 *发展”，讨论这种方法的好处。
 *
 *＜p＞注意，依赖依赖注入通常更好
 *（“推送”配置）通过setter配置应用程序对象
 *或构造函数，而不是像
 *BeanFactory查找。Spring的依赖注入功能是
 *使用这个BeanFactory接口及其子接口实现。
 *
 *＜p＞通常BeanFactory将加载存储在配置中的bean定义
 *源（如XML文档），并使用｛@code org.springframework.beans｝
 *包来配置bean。然而，实现可以简单地返回
 *它根据需要直接在Java代码中创建Java对象。没有
 *对如何存储定义的限制：LDAP、RDBMS、XML、，
 *财产文件等。鼓励实现支持引用
 *在bean之间（依赖注入）。
 *
 *＜p＞与｛@link ListableBeanFactory｝中的方法不同
 *如果这是一个
 *｛@link HierarchicalBeanFactory｝。如果在这个工厂实例中没有找到bean，
 *将询问直接母厂。此工厂实例中的bean
 *应该覆盖任何父工厂中同名的bean。
 *
 *＜p＞Bean工厂实现应该支持标准的Bean生命周期接口
 *尽可能地。整套初始化方法及其标准顺序为：
 *＜ol＞
 *<li>BeanNameAware的｛@code setBeanName｝
 *<li>BeanClassLoaderAware的｛@code setBeanClassLoader｝
 *<li>BeanFactory软件的｛@code setBeanFactory｝
 *<li>EnvironmentAware的｛@code setEnvironment｝
 *<li>EmbeddedValueResolverware的｛@code setEmbeddedValue Resolver｝
 *<li>ResourceLoaderAware的｛@code setResourceLoader｝
 *（仅在应用程序上下文中运行时适用）
 *<li>ApplicationEventPublisherware的｛@code setApplicationEventPublisher｝
 *（仅在应用程序上下文中运行时适用）
 *<li>MessageSourceAware的｛@code setMessageSource｝
 *（仅在应用程序上下文中运行时适用）
 *<li>ApplicationContextAware的｛@code setApplicationContext｝
 *（仅在应用程序上下文中运行时适用）
 *<li>ServletContextAware的｛@code setServletContext｝
 *（仅适用于在web应用程序上下文中运行时）
 *＜li＞BeanPostProcessors的｛@code postProcessBeforeInitialization｝方法
 *<li>在PropertiesSet之后初始化Bean的｛@code｝
 *＜li＞自定义｛@code init方法｝定义
 *＜li＞BeanPostProcessors的｛@code postProcessAfterInitialization｝方法
 *</ol>
 *
 *＜p＞关闭bean工厂时，应用以下生命周期方法：
 *＜ol＞
 *＜li＞DestructionAwareBeanPostProcessors的｛@code postProcessBeforeDestination｝方法
 *<li>DisposableBean的｛@code destroy｝
 *<li>自定义｛@code destroy方法｝定义
 *</ol>
 *
 *@作者Rod Johnson
 *@作者Juergen Hoeller
 *@作者Chris Beams
 *@自2001年4月13日起
 *@see BeanNameAware#setBeanName
 *@see BeanClassLoaderAware#setBeanClassLoader
 *@see BeanFactory软件#setBeanFactory
 *@see org.springframework.context.EnvironmentAware#setEnvironment
 *@see org.springframework.context.EmbeddedValueResolverWare#setEmbeddedValueResolver
 *@see org.springframework.context.ResourceLoaderAware#setResourceLoader
 *@see org.springframework.context.ApplicationEventPublisherWare#setApplicationEventPublisher
 *@see org.springframework.context.MessageSourceAware#setMessageSource
 *@see org.springframework.context.ApplicationContextAware#setApplicationContext
 *@see org.springframework.web.context.ServletContextAware#setServletContext
 *@see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization
 *@see InitializingBean#afterPropertiesSet
 *@see org.springframework.beans.factory.support.RootBeanDefinition#getInitMethodName
 *@see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization
 *@see org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor#postProcessBeforeDestination
 *@see DisposableBean#销毁
 *@see org.springframework.beans.factory.support.RootBeanDefinition#getDestroyMethodName
 */
public interface BeanFactory {

	/**
	 * Used to dereference a {@link FactoryBean} instance and distinguish it from
	 * beans <i>created</i> by the FactoryBean. For example, if the bean named
	 * {@code myJndiObject} is a FactoryBean, getting {@code &myJndiObject}
	 * will return the factory, not the instance returned by the factory.
	 */
	/**
	 *用于取消引用｛@link FactoryBean｝实例并将其与
	 *由FactoryBean创建的beans＜i＞。例如，如果名为
	 *｛@code myJndiObject｝是一个FactoryBean，正在获取｛@code&myJndiObject｝
	 *将返回工厂，而不是工厂返回的实例。
	 */
	String FACTORY_BEAN_PREFIX = "&";


	/**
	 * Return an instance, which may be shared or independent, of the specified bean.
	 * <p>This method allows a Spring BeanFactory to be used as a replacement for the
	 * Singleton or Prototype design pattern. Callers may retain references to
	 * returned objects in the case of Singleton beans.
	 * <p>Translates aliases back to the corresponding canonical bean name.
	 * <p>Will ask the parent factory if the bean cannot be found in this factory instance.
	 * @param name the name of the bean to retrieve
	 * @return an instance of the bean
	 * @throws NoSuchBeanDefinitionException if there is no bean with the specified name
	 * @throws BeansException if the bean could not be obtained
	 */
	/**
	 *返回指定bean的实例，该实例可以是共享的或独立的。
	 *＜p＞此方法允许使用SpringBeanFactory作为
	 *Singleton或原型设计模式。调用者可以保留对
	 *在Singleton bean的情况下返回对象。
	 *＜p＞将别名转换回相应的规范bean名称。
	 *＜p＞将询问父工厂是否在此工厂实例中找不到bean。
	 *@param name要检索的bean的名称
	 *@return bean的实例
	 *如果没有具有指定名称的bean，@throws NoSuchBeanDefinitionException
	 *如果无法获取bean，@throws BeansException
	 */
	Object getBean(String name) throws BeansException;

	/**
	 * Return an instance, which may be shared or independent, of the specified bean.
	 * <p>Behaves the same as {@link #getBean(String)}, but provides a measure of type
	 * safety by throwing a BeanNotOfRequiredTypeException if the bean is not of the
	 * required type. This means that ClassCastException can't be thrown on casting
	 * the result correctly, as can happen with {@link #getBean(String)}.
	 * <p>Translates aliases back to the corresponding canonical bean name.
	 * <p>Will ask the parent factory if the bean cannot be found in this factory instance.
	 * @param name the name of the bean to retrieve
	 * @param requiredType type the bean must match; can be an interface or superclass
	 * @return an instance of the bean
	 * @throws NoSuchBeanDefinitionException if there is no such bean definition
	 * @throws BeanNotOfRequiredTypeException if the bean is not of the required type
	 * @throws BeansException if the bean could not be created
	 */
	/**
	 *返回指定bean的实例，该实例可以是共享的或独立的。
	 *＜p＞行为与｛@link#getBean（String）｝相同，但提供了类型度量
	 *如果bean不属于
	 *所需类型。这意味着无法在强制转换时引发ClassCastException
	 *结果正确，正如｛@link#getBean（String）｝所发生的那样。
	 *＜p＞将别名转换回相应的规范bean名称。
	 *＜p＞将询问父工厂是否在此工厂实例中找不到bean。
	 *@param name要检索的bean的名称
	 *@param requiredType bean必须匹配的类型；可以是接口或超类
	 *@return bean的实例
	 *如果没有这样的bean定义，@throws NoSuchBeanDefinitionException
	 *如果bean不是所需类型，则@throws BeanNotOfRequiredTypeException
	 *如果无法创建bean，@throws BeansException
	 */
	<T> T getBean(String name, Class<T> requiredType) throws BeansException;

	/**
	 * Return an instance, which may be shared or independent, of the specified bean.
	 * <p>Allows for specifying explicit constructor arguments / factory method arguments,
	 * overriding the specified default arguments (if any) in the bean definition.
	 * @param name the name of the bean to retrieve
	 * @param args arguments to use when creating a bean instance using explicit arguments
	 * (only applied when creating a new instance as opposed to retrieving an existing one)
	 * @return an instance of the bean
	 * @throws NoSuchBeanDefinitionException if there is no such bean definition
	 * @throws BeanDefinitionStoreException if arguments have been given but
	 * the affected bean isn't a prototype
	 * @throws BeansException if the bean could not be created
	 * @since 2.5
	 */
	/**
	 *返回指定bean的实例，该实例可以是共享的或独立的。
	 *＜p＞允许指定显式构造函数参数/工厂方法参数，
	 *重写bean定义中指定的默认参数（如果有的话）。
	 *@param name要检索的bean的名称
	 *@param args使用显式参数创建bean实例时要使用的参数
	 *（仅在创建新实例而不是检索现有实例时应用）
	 *@return bean的实例
	 *如果没有这样的bean定义，@throws NoSuchBeanDefinitionException
	 *如果给定了参数，则@throws BeanDefinitionStoreException，但
	 *受影响的bean不是原型
	 *如果无法创建bean，@throws BeansException
	 *@自2.5
	 */
	Object getBean(String name, Object... args) throws BeansException;

	/**
	 * Return the bean instance that uniquely matches the given object type, if any.
	 * <p>This method goes into {@link ListableBeanFactory} by-type lookup territory
	 * but may also be translated into a conventional by-name lookup based on the name
	 * of the given type. For more extensive retrieval operations across sets of beans,
	 * use {@link ListableBeanFactory} and/or {@link BeanFactoryUtils}.
	 * @param requiredType type the bean must match; can be an interface or superclass
	 * @return an instance of the single bean matching the required type
	 * @throws NoSuchBeanDefinitionException if no bean of the given type was found
	 * @throws NoUniqueBeanDefinitionException if more than one bean of the given type was found
	 * @throws BeansException if the bean could not be created
	 * @since 3.0
	 * @see ListableBeanFactory
	 */
	/**
	 *返回唯一匹配给定对象类型的bean实例（如果有的话）。
	 *＜p＞此方法按类型查找区域进入｛@link ListableBeanFactory｝
	 *但也可以基于名称转换为传统的按名称查找
	 *给定类型的。对于跨多组bean的更广泛的检索操作，
	 *使用｛@link ListableBeanFactory｝和/或｛@linkBeanFactory Utils｝。
	 *@param requiredType bean必须匹配的类型；可以是接口或超类
	 *@返回与所需类型匹配的单个bean的实例
	 *如果找不到给定类型的bean，@throws NoSuchBeanDefinitionException
	 *如果找到多个给定类型的bean，@throws NoUniqueBeanDefinitionException
	 *如果无法创建bean，@throws BeansException
	 *@自3.0
	 *@参见ListableBeanFactory
	 */
	<T> T getBean(Class<T> requiredType) throws BeansException;

	/**
	 * Return an instance, which may be shared or independent, of the specified bean.
	 * <p>Allows for specifying explicit constructor arguments / factory method arguments,
	 * overriding the specified default arguments (if any) in the bean definition.
	 * <p>This method goes into {@link ListableBeanFactory} by-type lookup territory
	 * but may also be translated into a conventional by-name lookup based on the name
	 * of the given type. For more extensive retrieval operations across sets of beans,
	 * use {@link ListableBeanFactory} and/or {@link BeanFactoryUtils}.
	 * @param requiredType type the bean must match; can be an interface or superclass
	 * @param args arguments to use when creating a bean instance using explicit arguments
	 * (only applied when creating a new instance as opposed to retrieving an existing one)
	 * @return an instance of the bean
	 * @throws NoSuchBeanDefinitionException if there is no such bean definition
	 * @throws BeanDefinitionStoreException if arguments have been given but
	 * the affected bean isn't a prototype
	 * @throws BeansException if the bean could not be created
	 * @since 4.1
	 */
	/**
	 *返回指定bean的实例，该实例可以是共享的或独立的。
	 *＜p＞允许指定显式构造函数参数/工厂方法参数，
	 *重写bean定义中指定的默认参数（如果有的话）。
	 *＜p＞此方法按类型查找区域进入｛@link ListableBeanFactory｝
	 *但也可以基于名称转换为传统的按名称查找
	 *给定类型的。对于跨多组bean的更广泛的检索操作，
	 *使用｛@link ListableBeanFactory｝和/或｛@linkBeanFactory Utils｝。
	 *@param requiredType bean必须匹配的类型；可以是接口或超类
	 *@param args使用显式参数创建bean实例时要使用的参数
	 *（仅在创建新实例而不是检索现有实例时应用）
	 *@return bean的实例
	 *如果没有这样的bean定义，@throws NoSuchBeanDefinitionException
	 *如果给定了参数，则@throws BeanDefinitionStoreException，但
	 *受影响的bean不是原型
	 *如果无法创建bean，@throws BeansException
	 *@自4.1
	 */
	<T> T getBean(Class<T> requiredType, Object... args) throws BeansException;

	/**
	 * Return a provider for the specified bean, allowing for lazy on-demand retrieval
	 * of instances, including availability and uniqueness options.
	 * <p>For matching a generic type, consider {@link #getBeanProvider(ResolvableType)}.
	 * @param requiredType type the bean must match; can be an interface or superclass
	 * @return a corresponding provider handle
	 * @since 5.1
	 * @see #getBeanProvider(ResolvableType)
	 */
	/**
	 *返回指定bean的提供程序，允许延迟按需检索
	 *实例，包括可用性和唯一性选项。
	 *＜p＞要匹配泛型类型，请考虑｛@link#getBeanProvider（ResolutibleType）｝。
	 *@param requiredType bean必须匹配的类型；可以是接口或超类
	 *@返回相应的提供程序句柄
	 *@自5.1
	 *@参见#getBeanProvider（可解析类型）
	 */
	<T> ObjectProvider<T> getBeanProvider(Class<T> requiredType);

	/**
	 * Return a provider for the specified bean, allowing for lazy on-demand retrieval
	 * of instances, including availability and uniqueness options. This variant allows
	 * for specifying a generic type to match, similar to reflective injection points
	 * with generic type declarations in method/constructor parameters.
	 * <p>Note that collections of beans are not supported here, in contrast to reflective
	 * injection points. For programmatically retrieving a list of beans matching a
	 * specific type, specify the actual bean type as an argument here and subsequently
	 * use {@link ObjectProvider#orderedStream()} or its lazy streaming/iteration options.
	 * <p>Also, generics matching is strict here, as per the Java assignment rules.
	 * For lenient fallback matching with unchecked semantics (similar to the ´unchecked´
	 * Java compiler warning), consider calling {@link #getBeanProvider(Class)} with the
	 * raw type as a second step if no full generic match is
	 * {@link ObjectProvider#getIfAvailable() available} with this variant.
	 * @return a corresponding provider handle
	 * @param requiredType type the bean must match; can be a generic type declaration
	 * @since 5.1
	 * @see ObjectProvider#iterator()
	 * @see ObjectProvider#stream()
	 * @see ObjectProvider#orderedStream()
	 */
	/**
	 *返回指定bean的提供程序，允许延迟按需检索
	 *实例，包括可用性和唯一性选项。此变体允许
	 *用于指定要匹配的泛型类型，类似于反射注入点
	 *方法/构造函数参数中的泛型类型声明。
	 *＜p＞注意，这里不支持bean的集合，而不是反射
	 *注入点。用于以编程方式检索与
	 *具体类型，在此处指定实际的bean类型作为参数，然后
	 *使用｛@link ObjectProvider#orderedStream（）｝或其惰性流/迭代选项。
	 *＜p＞此外，根据Java赋值规则，泛型匹配在这里是严格的。
	 *对于具有未检查语义的宽松回退匹配（类似于“未检查”
	 *Java编译器警告），请考虑使用
	 *如果没有完全的泛型匹配，则将原始类型作为第二步
	 *｛@link ObjectProvider#getIfAvailable（）可用｝。
	 *@返回相应的提供程序句柄
	 *@param requiredType bean必须匹配的类型；可以是泛型类型声明
	 *@自5.1
	 *@see ObjectProvider#迭代器（）
	 *@see ObjectProvider#stream（）
	 *@see ObjectProvider#orderedStream（）
	 */
	<T> ObjectProvider<T> getBeanProvider(ResolvableType requiredType);

	/**
	 * Does this bean factory contain a bean definition or externally registered singleton
	 * instance with the given name?
	 * <p>If the given name is an alias, it will be translated back to the corresponding
	 * canonical bean name.
	 * <p>If this factory is hierarchical, will ask any parent factory if the bean cannot
	 * be found in this factory instance.
	 * <p>If a bean definition or singleton instance matching the given name is found,
	 * this method will return {@code true} whether the named bean definition is concrete
	 * or abstract, lazy or eager, in scope or not. Therefore, note that a {@code true}
	 * return value from this method does not necessarily indicate that {@link #getBean}
	 * will be able to obtain an instance for the same name.
	 * @param name the name of the bean to query
	 * @return whether a bean with the given name is present
	 */
	/**
	 *这个bean工厂是否包含bean定义或外部注册的singleton
	 *具有给定名称的实例？
	 *＜p＞如果给定的名称是别名，它将被转换回对应的
	 *规范bean名称。
	 *＜p＞如果此工厂是分层的，将询问任何父工厂bean是否不能
	 *在此工厂实例中找到。
	 *＜p＞如果找到与给定名称匹配的bean定义或单例实例，
	 *该方法将返回｛@code true｝指定的bean定义是否具体
	 *或抽象，或懒惰，或渴望，在范围内或不。因此，请注意｛@code true｝
	 *此方法的返回值不一定表示｛@link#getBean｝
	 *将能够获得相同名称的实例。
	 *@param name要查询的bean的名称
	 *@return是否存在具有给定名称的bean
	 */
	boolean containsBean(String name);

	/**
	 * Is this bean a shared singleton? That is, will {@link #getBean} always
	 * return the same instance?
	 * <p>Note: This method returning {@code false} does not clearly indicate
	 * independent instances. It indicates non-singleton instances, which may correspond
	 * to a scoped bean as well. Use the {@link #isPrototype} operation to explicitly
	 * check for independent instances.
	 * <p>Translates aliases back to the corresponding canonical bean name.
	 * <p>Will ask the parent factory if the bean cannot be found in this factory instance.
	 * @param name the name of the bean to query
	 * @return whether this bean corresponds to a singleton instance
	 * @throws NoSuchBeanDefinitionException if there is no bean with the given name
	 * @see #getBean
	 * @see #isPrototype
	 */
	/**
	 *这个bean是共享的单例吗？也就是说，｛@link#getBean｝将始终
	 *返回相同的实例？
	 *＜p＞注意：这个返回｛@code false｝的方法并没有明确指出
	 *独立实例。它表示非单例实例，可能对应
	 *到作用域bean。使用｛@link#isPrototype｝操作显式
	 *检查独立实例。
	 *＜p＞将别名转换回相应的规范bean名称。
	 *＜p＞将询问父工厂是否在此工厂实例中找不到bean。
	 *@param name要查询的bean的名称
	 *@return此bean是否对应于单例实例
	 *如果没有具有给定名称的bean，@throws NoSuchBeanDefinitionException
	 *@参见#getBean
	 *@参见#isPrototype
	 */
	boolean isSingleton(String name) throws NoSuchBeanDefinitionException;

	/**
	 * Is this bean a prototype? That is, will {@link #getBean} always return
	 * independent instances?
	 * <p>Note: This method returning {@code false} does not clearly indicate
	 * a singleton object. It indicates non-independent instances, which may correspond
	 * to a scoped bean as well. Use the {@link #isSingleton} operation to explicitly
	 * check for a shared singleton instance.
	 * <p>Translates aliases back to the corresponding canonical bean name.
	 * <p>Will ask the parent factory if the bean cannot be found in this factory instance.
	 * @param name the name of the bean to query
	 * @return whether this bean will always deliver independent instances
	 * @throws NoSuchBeanDefinitionException if there is no bean with the given name
	 * @since 2.0.3
	 * @see #getBean
	 * @see #isSingleton
	 */
	/**
	 *这个bean是原型吗？也就是说，｛@link#getBean｝将始终返回
	 *独立实例？
	 *＜p＞注意：这个返回｛@code false｝的方法并没有明确指出
	 *单一对象。它表示可能对应的非独立实例
	 *到作用域bean。使用｛@link#isSingleton｝操作显式
	 *检查共享的单例实例。
	 *＜p＞将别名转换回相应的规范bean名称。
	 *＜p＞将询问父工厂是否在此工厂实例中找不到bean。
	 *@param name要查询的bean的名称
	 *@return此bean是否始终传递独立实例
	 *如果没有具有给定名称的bean，@throws NoSuchBeanDefinitionException
	 *@自2.0.3起
	 *@参见#getBean
	 *@参见#isSingleton
	 */
	boolean isPrototype(String name) throws NoSuchBeanDefinitionException;

	/**
	 * Check whether the bean with the given name matches the specified type.
	 * More specifically, check whether a {@link #getBean} call for the given name
	 * would return an object that is assignable to the specified target type.
	 * <p>Translates aliases back to the corresponding canonical bean name.
	 * <p>Will ask the parent factory if the bean cannot be found in this factory instance.
	 * @param name the name of the bean to query
	 * @param typeToMatch the type to match against (as a {@code ResolvableType})
	 * @return {@code true} if the bean type matches,
	 * {@code false} if it doesn't match or cannot be determined yet
	 * @throws NoSuchBeanDefinitionException if there is no bean with the given name
	 * @since 4.2
	 * @see #getBean
	 * @see #getType
	 */
	/**
	 *检查具有给定名称的bean是否与指定类型匹配。
	 *更具体地说，检查是否为给定名称调用了｛@link#getBean｝
	 *将返回可分配给指定目标类型的对象。
	 *＜p＞将别名转换回相应的规范bean名称。
	 *＜p＞将询问父工厂是否在此工厂实例中找不到bean。
	 *@param name要查询的bean的名称
	 *@param typeToMatch要匹配的类型（作为｛@code ResolutibleType｝）
	 *@return｛@code true｝如果bean类型匹配，
	 *｛@code false｝如果不匹配或无法确定
	 *如果没有具有给定名称的bean，@throws NoSuchBeanDefinitionException
	 *@自4.2
	 *@参见#getBean
	 *@参见#getType
	 */
	boolean isTypeMatch(String name, ResolvableType typeToMatch) throws NoSuchBeanDefinitionException;

	/**
	 * Check whether the bean with the given name matches the specified type.
	 * More specifically, check whether a {@link #getBean} call for the given name
	 * would return an object that is assignable to the specified target type.
	 * <p>Translates aliases back to the corresponding canonical bean name.
	 * <p>Will ask the parent factory if the bean cannot be found in this factory instance.
	 * @param name the name of the bean to query
	 * @param typeToMatch the type to match against (as a {@code Class})
	 * @return {@code true} if the bean type matches,
	 * {@code false} if it doesn't match or cannot be determined yet
	 * @throws NoSuchBeanDefinitionException if there is no bean with the given name
	 * @since 2.0.1
	 * @see #getBean
	 * @see #getType
	 */
	/**
	 *检查具有给定名称的bean是否与指定类型匹配。
	 *更具体地说，检查是否为给定名称调用了｛@link#getBean｝
	 *将返回可分配给指定目标类型的对象。
	 *＜p＞将别名转换回相应的规范bean名称。
	 *＜p＞将询问父工厂是否在此工厂实例中找不到bean。
	 *@param name要查询的bean的名称
	 *@param typeToMatch要匹配的类型（作为｛@code Class｝）
	 *@return｛@code true｝如果bean类型匹配，
	 *｛@code false｝如果不匹配或无法确定
	 *如果没有具有给定名称的bean，@throws NoSuchBeanDefinitionException
	 *@自2.0.1起
	 *@参见#getBean
	 *@参见#getType
	 */
	boolean isTypeMatch(String name, Class<?> typeToMatch) throws NoSuchBeanDefinitionException;

	/**
	 * Determine the type of the bean with the given name. More specifically,
	 * determine the type of object that {@link #getBean} would return for the given name.
	 * <p>For a {@link FactoryBean}, return the type of object that the FactoryBean creates,
	 * as exposed by {@link FactoryBean#getObjectType()}. This may lead to the initialization
	 * of a previously uninitialized {@code FactoryBean} (see {@link #getType(String, boolean)}).
	 * <p>Translates aliases back to the corresponding canonical bean name.
	 * <p>Will ask the parent factory if the bean cannot be found in this factory instance.
	 * @param name the name of the bean to query
	 * @return the type of the bean, or {@code null} if not determinable
	 * @throws NoSuchBeanDefinitionException if there is no bean with the given name
	 * @since 1.1.2
	 * @see #getBean
	 * @see #isTypeMatch
	 */
	/**
	 *确定具有给定名称的bean的类型。更具体地，
	 *确定｛@link#getBean｝将为给定名称返回的对象类型。
	 *＜p＞对于｛@link FactoryBean｝，返回FactoryBean创建的对象类型，
	 *如｛@link FactoryBean#getObjectType（）｝所公开的。这可能导致初始化
	 *之前未初始化的｛@code FactoryBean｝（请参见｛@link#getType（String，boolean）｝）。
	 *＜p＞将别名转换回相应的规范bean名称。
	 *＜p＞将询问父工厂是否在此工厂实例中找不到bean。
	 *@param name要查询的bean的名称
	 *@返回bean的类型，如果无法确定，则返回｛@code null｝
	 *如果没有具有给定名称的bean，@throws NoSuchBeanDefinitionException
	 *@自1.1.2
	 *@参见#getBean
	 *@参见#isTypeMatch
	 */
	@Nullable
	Class<?> getType(String name) throws NoSuchBeanDefinitionException;

	/**
	 * Determine the type of the bean with the given name. More specifically,
	 * determine the type of object that {@link #getBean} would return for the given name.
	 * <p>For a {@link FactoryBean}, return the type of object that the FactoryBean creates,
	 * as exposed by {@link FactoryBean#getObjectType()}. Depending on the
	 * {@code allowFactoryBeanInit} flag, this may lead to the initialization of a previously
	 * uninitialized {@code FactoryBean} if no early type information is available.
	 * <p>Translates aliases back to the corresponding canonical bean name.
	 * <p>Will ask the parent factory if the bean cannot be found in this factory instance.
	 * @param name the name of the bean to query
	 * @param allowFactoryBeanInit whether a {@code FactoryBean} may get initialized
	 * just for the purpose of determining its object type
	 * @return the type of the bean, or {@code null} if not determinable
	 * @throws NoSuchBeanDefinitionException if there is no bean with the given name
	 * @since 5.2
	 * @see #getBean
	 * @see #isTypeMatch
	 */
	/**
	 *确定具有给定名称的bean的类型。更具体地，
	 *确定｛@link#getBean｝将为给定名称返回的对象类型。
	 *＜p＞对于｛@link FactoryBean｝，返回FactoryBean创建的对象类型，
	 *如｛@link FactoryBean#getObjectType（）｝所公开的。取决于
	 *｛@code allowFactoryBeanInit｝标志，这可能会导致之前
	 *如果没有早期类型信息，则取消初始化｛@code FactoryBean｝。
	 *＜p＞将别名转换回相应的规范bean名称。
	 *＜p＞将询问父工厂是否在此工厂实例中找不到bean。
	 *@param name要查询的bean的名称
	 *@param allowFactoryBean检查｛@code FactoryBean｝是否可以初始化
	 *仅用于确定其对象类型
	 *@返回bean的类型，如果无法确定，则返回｛@code null｝
	 *如果没有具有给定名称的bean，@throws NoSuchBeanDefinitionException
	 *@自5.2
	 *@参见#getBean
	 *@参见#isTypeMatch
	 */
	@Nullable
	Class<?> getType(String name, boolean allowFactoryBeanInit) throws NoSuchBeanDefinitionException;

	/**
	 * Return the aliases for the given bean name, if any.
	 * <p>All of those aliases point to the same bean when used in a {@link #getBean} call.
	 * <p>If the given name is an alias, the corresponding original bean name
	 * and other aliases (if any) will be returned, with the original bean name
	 * being the first element in the array.
	 * <p>Will ask the parent factory if the bean cannot be found in this factory instance.
	 * @param name the bean name to check for aliases
	 * @return the aliases, or an empty array if none
	 * @see #getBean
	 */
	/**
	 *返回给定bean名称的别名（如果有的话）。
	 *＜p＞当在｛@link#getBean｝调用中使用时，所有这些别名都指向同一个bean。
	 *＜p＞如果给定的名称是别名，则对应的原始bean名称
	 *和其他别名（如果有的话），将返回原始bean名称
	 *是阵列中的第一个元素。
	 *＜p＞将询问父工厂是否在此工厂实例中找不到bean。
	 *@param name要检查别名的bean名称
	 *@返回别名，如果没有，则返回空数组
	 *@参见#getBean
	 */
	String[] getAliases(String name);

}
